package SimpleFactory;

/**
 * 功能:
 * 作者: ldl
 * 时间: 2016-08-10 15:36
 */
public class OperationFactory {

    public static Operation createOperation(String oper) {
        switch (oper) {
            case "+":
                return new Add();
            case "-":
                return new Sub();
            case "*":
                return new Mul();
            case "/":
                return new Div();
            default:
                return null;
        }
    }
}
